<!DOCTYPE html>
<html lang="zh-cn">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<meta name="renderer" content="webkit">
		<title>招生管理</title>
		<import type='css' file="admin.pintuer4.css.pintuer" />
		<import type='css' file="admin.pintuer4.css.admin" />
		<import type='js' file="My97DatePicker.WdatePicker" />
		<link type="image/x-icon" href="http://www.pintuer.com/favicon.ico" rel="shortcut icon" />
		<link href="http://www.pintuer.com/favicon.ico" rel="bookmark icon" />
	</head>

	<body>
		<include file="Public:header" />
	<!--内容-->
	<div class="layout">
		<div class="admin">
		<form method="post">
	    <div class="panel admin-panel">
	    	<div class="panel-head"><strong>招生列表</strong></div>
	        <div class="padding border-bottom" style="overflow: hidden;">
	        
	        
	        <input type="text" class="input" id="start_time" placeholder="报名开始时间" value="{$_GET['start_time']}" style="width: 200px;float: left;" size="50" onclick="WdatePicker()"/>
	        <input type="text" class="input" id="end_time" placeholder="报名结束时间" value="{$_GET['end_time']}" style="width: 200px;float: left;margin-left: 20px;" size="50" onclick="WdatePicker()"/>
	        <select id="s_province" class="input" style="width: 100px;float: left;margin-left: 20px;">
	        <option value="0">选择省份</option>
	        
			</select>
			
			
			<select id="s_city" class="input" style="width: 100px;float: left;margin-left: 20px;">
	        <option value="0">选择城市</option>
	        
			</select>
			
			
			<select id="s_county" class="input" style="width: 100px;float: left;margin-left: 20px;">
	        <option value="0">选择区县</option>
	        
			</select>
			
			
			
			
	        <a style="float: left;margin-left: 20px;" id="shaixuan" class="button button-small border-green" href="javascript:;">筛选</a>
	        <a style="float: left;margin-left: 20px;"  class="button button-small border-green" href="{:U('Enroll/enroll_list')}">撤销筛选</a>
	        <a style="float: left;margin-left: 20px;" id="excel" class="button button-small border-green" href="javascript:;">导出EXCLE</a>
	        
	        
	        
				<a style="float: right;margin-left: 20px;" id="search" class="button button-small border-green" href="javascript:;">搜索</a>
				<input class="input input-small" placeholder="输入报名号或学生姓名" style="width: 200px;float: right;" id="search_word" name="search_word" value="{$_GET['search_word']}">
			</div>
	        <table class="table table-hover">
	        	<tr><th>用户名</th><th>报名号</th><th>学生姓名</th><th>性别</th><th>招生片区</th><th>年制</th><th>缴费情况</th><th>报名时间</th><th>操作</th></tr>
	        	<volist name="list" id="a">
	        	<tr>
	        		<td>{$a['user'].username}</td>
	        		<td>{$a.enroll_num}</td>
		        	<td>{$a.name}</td>
		        	<td>
		        	<if condition="$a['sex'] eq 1">男
		        	<else/>女
		        	</if>
					</td>
		        	<td>{$a.s_city}{$a.s_county}</td>
		        	<td>
		        	<if condition="$a['year'] eq 1">三年</if>
		        	<if condition="$a['year'] eq 2">四年</if>
		        	</td>
		        	<td>已缴费{$a.cost}元</td>
		        	<td>
		        	{$a['create_time']|date='Y-m-d H:i:s',###}
		        	<td>
		        	
		        	<a class="button border-blue button-little" href="{:U('Enroll/eroll_detail')}?id={$a.id}">查看详情</a>
		        	<a class="button border-blue button-little" href="{:U('Enroll/img_out')}?id={$a.id}">查看报名电子表</a>
		        	</td>
	        	</tr>
	        	</volist>
	        </table>
	    </div>
	    </form>
	    </div>
	    <div class="meneame" style="margin-bottom: 20px;">{$page}</div>
	    </div>
	    <div>
	    </div>
		<!--底部-->
		
		<import type='js' file="admin.pintuer4.js.jquery" />
		<import type='js' file="admin.pintuer4.js.pintuer" />
		<import type='js' file="admin.pintuer4.js.respond" />
		<import type='js' file="admin.pintuer4.js.layer" />
		<import type='js' file="admin.pintuer4.js.admin" />
		<script>
			$(function() {
				//大于移动端800宽度才弹出提示
				if ($(window).width() >= 800) {
					layer.open({
						type: 1,
						shade: false,
						title: false, //不显示标题
						area: ['420px', '640px'],
						content: $('#alert-talk'), //捕获的元素
						cancel: function(index) {
							layer.close(index);
						}
					});
				}




				//获取区域代码
				url = "{:U('Enroll/get_area')}";

				s_p = "{$_GET['s_province']}";
				s_c = "{$_GET['s_city']}";
				s_a = "{$_GET['s_county']}";
				
				$.post(url,function(json){
					if(json){
						for(i=0;i<json.length;i++){
							if(s_p == json[i].name){
								$('#s_province').append('<option selected="selected" value="'+json[i].name+'">'+json[i].name+'</option>');
							}else{
								$('#s_province').append('<option value="'+json[i].name+'">'+json[i].name+'</option>');
							}
						}
					}

					if(s_p){
						$.post(url,{leave:1,name:s_p},function(json){
							if(json){
								$('#s_city').html('<option value="0">选择城市</option>');
								$('#s_county').html('<option value="0">选择区县</option>');
								for(i=0;i<json.length;i++){

									if(s_c == json[i].name){
										$('#s_city').append('<option selected="selected" value="'+json[i].name+'">'+json[i].name+'</option>');
									}else{
										$('#s_city').append('<option value="'+json[i].name+'">'+json[i].name+'</option>');
									}
									
								}
							}
						});

					}

					if(s_c){
						$.post(url,{leave:2,name:s_c},function(json){
							if(json){
								$('#s_county').html('<option value="0">选择区县</option>');
								for(i=0;i<json.length;i++){
									if(s_a == json[i].name){
										$('#s_county').append('<option selected="selected" value="'+json[i].name+'">'+json[i].name+'</option>');
									}else{
										$('#s_county').append('<option value="'+json[i].name+'">'+json[i].name+'</option>');
									}
								}
							}
						});

					}

					
				});

				$('#s_province').change(function(){
					s_province = $(this).val();
					if(s_province != 0){
						$.post(url,{leave:1,name:s_province},function(json){
							if(json){
								$('#s_city').html('<option value="0">选择城市</option>');
								$('#s_county').html('<option value="0">选择区县</option>');
								for(i=0;i<json.length;i++){
									$('#s_city').append('<option value="'+json[i].name+'">'+json[i].name+'</option>');
								}
							}
						});
					}
				});



				$('#s_city').change(function(){
					s_city = $(this).val();
					if(s_city != 0){
						$.post(url,{leave:2,name:s_city},function(json){
							if(json){
								$('#s_county').html('<option value="0">选择区县</option>');
								for(i=0;i<json.length;i++){
									$('#s_county').append('<option value="'+json[i].name+'">'+json[i].name+'</option>');
								}
							}
						});
					}
				});
				


				
			});
		</script>
		<script type="text/javascript">
			$(function(){
				$('#search').click(function(){
					url = window.location.pathname +  '?search_word=' + $('#search_word').val();
					location.href = url;
				});


				$('#shaixuan').click(function(){
					url  = window.location.pathname;
					url += '?start_time=' + $('#start_time').val();
					url += '&end_time=' + $('#end_time').val();
					url += '&s_province=' + $('#s_province').val();
					url += '&s_city=' + $('#s_city').val();
					url += '&s_county=' + $('#s_county').val();
					location.href = url;
				});

				$('#excel').click(function(){
					url  = "{:U('Enroll/excel')}";
					url += '?start_time=' + $('#start_time').val();
					url += '&end_time=' + $('#end_time').val();
					url += '&s_province=' + $('#s_province').val();
					url += '&s_city=' + $('#s_city').val();
					url += '&s_county=' + $('#s_county').val();
					location.href = url;
				});
				
				
			
				$('#search_word').bind('keypress',function(event){
			        if(event.keyCode == "13")    
			        {
			        	url = window.location.pathname +  '?search_word=' + $('#search_word').val();
			    		location.href = url;
			        }
			    });
				
			})
	</script>
	</body>

</html>